package mytest.wd2;

import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;

import java.util.Map;

public class TestJson {

    public static void main(String[] args) {
        String s1 = "{\n" +
                "    \"ch\": null,\n" +
                "    \"channel\": \"alend\",\n" +
                "    \"channelSub\": null,\n" +
                "    \"data_version\": \"V1.0\",\n" +
                "    \"phone\": \"8108173607\",\n" +
                "    \"platform\": \"alend\",\n" +
                "    \"realName\": \"8108173607\",\n" +
                "    \"recordGid\": \"02dd0328-eacf-4e54-b745-59d2dba6\",\n" +
                "    \"source\": \"alend\",\n" +
                "    \"sptype\": \"user.credit.application\",\n" +
                "    \"totalNum\": \"1\",\n" +
                "    \"userGreyed\": \"false\",\n" +
                "    \"report\": {\n" +
                "        \"nigfacecheck\": {\n" +
                "            \"liveUrl\": \"https://starfruit-ngn.afr-nigeria.ufileos.com/c16b8d728c1843bc8f177d945398c65b_1722391578166_9232e2802a644da59ba21deff8beffecjpg.jpg?UCloudPublicKey=TOKEN_a59a9232-c7ac-4cab-be2b-4aad4834099a&Signature=4XKgBV0PxwvhOCnzVV2iPh%2FFrDs%3D&Expires=2037751578\",\n" +
                "            \"credit_living\": {\n" +
                "                \"verifySource\": \"ad\",\n" +
                "                \"channel\": \"alend\",\n" +
                "                \"livenessId\": \"d3122f50cf72ac53\",\n" +
                "                \"livenessScore\": \"100\"\n" +
                "            },\n" +
                "            \"face_check\": {\n" +
                "                \"id\": \"66a99c1a60dad2b566055a18\",\n" +
                "                \"validations\": {\n" +
                "                    \"data\": {\n" +
                "                        \"lastName\": {\n" +
                "                            \"validated\": \"true\",\n" +
                "                            \"value\": \"Adetoro\"\n" +
                "                        },\n" +
                "                        \"dateOfBirth\": {\n" +
                "                            \"validated\": \"true\",\n" +
                "                            \"value\": \"1998-05-06\"\n" +
                "                        },\n" +
                "                        \"firstName\": {\n" +
                "                            \"validated\": \"false\",\n" +
                "                            \"value\": \"Prosper\"\n" +
                "                        }\n" +
                "                    },\n" +
                "                    \"selfie\": {\n" +
                "                        \"selfieVerification\": {\n" +
                "                            \"confidenceLevel\": \"83.0\",\n" +
                "                            \"threshold\": \"80.0\",\n" +
                "                            \"match\": \"true\",\n" +
                "                            \"image\": \"https://starfruit-ngn.afr-nigeria.ufileos.com/c16b8d728c1843bc8f177d945398c65b_1722391578166_9232e2802a644da59ba21deff8beffecjpg.jpg?UCloudPublicKey=TOKEN_a59a9232-c7ac-4cab-be2b-4aad4834099a&Signature=4XKgBV0PxwvhOCnzVV2iPh%2FFrDs%3D&Expires=2037751578\"\n" +
                "                        }\n" +
                "                    },\n" +
                "                    \"validationMessages\": \"First name does not match\"\n" +
                "                },\n" +
                "                \"status\": \"found\",\n" +
                "                \"dataValidation\": \"true\",\n" +
                "                \"selfieValidation\": \"true\",\n" +
                "                \"firstName\": \"TOPE\",\n" +
                "                \"middleName\": \"PROSPER\",\n" +
                "                \"lastName\": \"ADETORO\",\n" +
                "                \"mobile\": \"08108173607\",\n" +
                "                \"dateOfBirth\": \"1998-05-06\",\n" +
                "                \"isConsent\": \"true\",\n" +
                "                \"idNumber\": \"22358357128\",\n" +
                "                \"shouldRetrivedNin\": \"true\",\n" +
                "                \"businessId\": \"655c1bf28e2bbd4dd78cc411\",\n" +
                "                \"type\": \"bvn\",\n" +
                "                \"allValidationPassed\": \"false\",\n" +
                "                \"requestedAt\": \"2024-07-31T02:06:23.665Z\",\n" +
                "                \"requestedById\": \"655c1bf28e2bbd09e58cc412\",\n" +
                "                \"country\": \"NG\",\n" +
                "                \"createdAt\": \"2024-07-31T02:06:23.682Z\",\n" +
                "                \"lastModifiedAt\": \"2024-07-31T02:06:23.682Z\",\n" +
                "                \"registrationDate\": \"Invalid date\",\n" +
                "                \"gender\": \"Female\",\n" +
                "                \"fullDetails\": \"false\",\n" +
                "                \"metadata\": {\n" +
                "                    \"requestId\": \"1c1c231f58\"\n" +
                "                },\n" +
                "                \"requestedBy\": {\n" +
                "                    \"firstName\": \"API\",\n" +
                "                    \"lastName\": \"User\",\n" +
                "                    \"id\": \"655c1bf28e2bbd09e58cc412\"\n" +
                "                },\n" +
                "                \"image\": \"https://starfruit-ngn.afr-nigeria.ufileos.com/7e59bb7ce23f43c8903c3cdfc84197e2_1722391583800_c9c18f3398634db68e295c2fa8631183jpg.jpg?UCloudPublicKey=TOKEN_a59a9232-c7ac-4cab-be2b-4aad4834099a&Signature=fqcuAMVuKHpmxWkvPT1wGSVwuJ0%3D&Expires=2037751583\"\n" +
                "            }\n" +
                "        },\n" +
                "        \"nigcontact\": [\n" +
                "            {\n" +
                "                \"relation\": \"1\",\n" +
                "                \"name\": \"Faith\",\n" +
                "                \"phoneNo\": \"09040211560\"\n" +
                "            },\n" +
                "            {\n" +
                "                \"relation\": \"4\",\n" +
                "                \"name\": \"Precious \",\n" +
                "                \"phoneNo\": \"09127976712\"\n" +
                "            },\n" +
                "            {\n" +
                "                \"relation\": \"1\",\n" +
                "                \"name\": \"Kemi\",\n" +
                "                \"phoneNo\": \"09014613854\"\n" +
                "            }\n" +
                "        ],\n" +
                "        \"nigpersoninfo\": {\n" +
                "            \"name\": \"Prosper\",\n" +
                "            \"middleName\": \"Tope\",\n" +
                "            \"lastName\": \"Adetoro\",\n" +
                "            \"birthday\": \"1998/05/06\",\n" +
                "            \"gender\": \"1\",\n" +
                "            \"email\": \"Oluwapeegotcha@gmail.com\",\n" +
                "            \"bvnNumber\": \"22358357128\",\n" +
                "            \"education\": \"2\",\n" +
                "            \"state\": \"Lagos State\",\n" +
                "            \"city\": \"Agege\",\n" +
                "            \"address\": \"Ijaiye medium housing estate \",\n" +
                "            \"residentialStatus\": \"2\",\n" +
                "            \"monthlyIncome\": \"6\",\n" +
                "            \"maritalStatus\": \"1\",\n" +
                "            \"firstLanguage\": \"1\",\n" +
                "            \"religion\": \"2\"\n" +
                "        }\n" +
                "    },\n" +
                "    \"bg_user_gid\": \"304238b784e24a81bdc30fc63e99a6dc\",\n" +
                "    \"biz_user_gid\": \"3148b4fc-ad65-4e56-961a-4b4221eef6c8\",\n" +
                "    \"workflow_gid\": \"8c4269d516b849ca862273c55dc7ddbe\",\n" +
                "    \"simpleCredit\": \"0\",\n" +
                "    \"channelSubSpread\": null,\n" +
                "    \"s_path\": \"/data/bigdata/creditreport/metric.20240731.log\",\n" +
                "    \"s_line_num\": \"72\",\n" +
                "    \"s_host\": \"ngn-as-02a2\",\n" +
                "    \"s_site\": \"ngn\",\n" +
                "    \"s_forwarder\": \"ngn-as-02a2,1722391584\",\n" +
                "    \"time\": \"1722391584\",\n" +
                "    \"tag\": \"spider.creditreport\",\n" +
                "    \"original\": \"120206\",\n" +
                "    \"record_gid\": \"nj-f24244fc-65e5-4843-8b28-2fa86513abe4\",\n" +
                "    \"total_num\": \"1\",\n" +
                "    \"vendor\": \"nigeria\",\n" +
                "    \"biz_type\": \"alend\",\n" +
                "    \"terminal_type\": null,\n" +
                "    \"biz_channel\": null,\n" +
                "    \"biz_sub_channel\": null,\n" +
                "    \"one_time\": \"2024-07-31 10:06:35\",\n" +
                "    \"token_id\": \"246be82af3ae4bbf939567348367cdc1\",\n" +
                "    \"org_task_type\": \"DA\",\n" +
                "    \"workflow_name\": \"user.credit.application\",\n" +
                "    \"task_gid\": \"f0ea45745e2444b29e087347bbcf34ff\",\n" +
                "    \"crawler_time\": \"1722391583905\",\n" +
                "    \"idcard\": \"008663608108173607743\"\n" +
                "}\n";

        Map<String, Object> map = JSONObject.parseObject(s1);
        String a = (String) map.get("ch");
        System.out.println(StringUtils.isBlank(a));
    }

}
